@import './element-variables';

// 深色主题的特殊样式
body {
  background: $--color-text-secondary;
  color: $--color-text-primary;
  // @include scrollBar($--color-primary, $--color-text-secondary);

  /*修改框架本身的样式
  ----------------------------------------------------------------------------------*/
  .el-header,
  .collapse-btn {
    background-color: rgba($--background-color-base, 0.6);
  }

  /*Menu*/
  .el-menu {
    background: rgba($--background-color-base, 0.6);
    border: none;

    &-item {
      color: $--color-text-regular;
      i {
        // color: inherit;
        color: $--color-primary;
      }
    }
  }

  .el-submenu {
    &__title {
      color: $--color-text-regular;
      i {
        color: inherit;
      }
      &:hover {
        background-color: $--background-color-show;
      }
    }
  }

  .el-menu .el-menu-item,
  .el-submenu {
    min-width: auto;

    // BootStrap图标与Element图标保持一致
    [class^='bi-'] {
      vertical-align: middle;
      margin-right: 5px;
      width: 24px;
      text-align: center;
      font-size: 17px;
    }
  }

  // 侧边导航栏
  .el-menu-item.is-active {
    background-color: $--color-primary;
    color: $--color-white;
  }
  .el-submenu__title i {
    color: $--color-primary;
  }

  /*card*/
  // .el-card {
  //   background: rgba(1, 8, 27, 0.4);
  //   border: none;
  //   height: 100%;

  //   &.is-always-shadow {
  //     box-shadow: 0 0 2px 2px rgba(76, 119, 169, 0.7);
  //   }
  // }

  /*Tabs*/
  .el-tabs__item {
    color: $--color-text-regular;
  }
  .el-tabs--card > .el-tabs__header .el-tabs__nav {
    border: none;
  }
  .el-tabs--card > .el-tabs__header .el-tabs__item {
    border-right: none;
    border-left: none;
    background-color: #efeff1;
  }
  .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
    border-bottom-color: $--color-primary;
  }

  /* Table*/
  .el-table {
    background-color: transparent;
    border-radius: 5px;
    border-color: $--color-primary !important;
    border: 1px solid;
    tr,
    &__fixed-right-patch {
      background-color: transparent;
    }
    &__body tr.hover-row > td,
    &__body tr.current-row > td {
      background-color: rgba($--color-primary, 0.2);
    }
    &__header tr,
    &__header th {
      background-color: $--color-primary;
      color: $--color-text-secondary;
      font-weight: bold;
      border: none;
      &.el-table__cell{
        background-color: $--color-primary;
      }
    }

    &__body tr,
    td {
      border-color: $--border-color-base !important;
    }
  }
  .el-table::before,
  .el-table::after {
    background-color: $--color-primary !important;
  }
  .el-table th.is-leaf {
    border-color: $--color-primary !important;
  }

  /* DatePicker*/
  .el-picker-panel {
    background-color: $--background-color-base;
    border: 1px solid $--border-color-base;
    color: $--color-black;

    &__sidebar,
    &__footer {
      background-color: $--background-color-base;
    }
  }

  .el-date-range-picker__content,
  .el-date-range-picker__time-header,
  .el-picker-panel__footer,
  .el-picker-panel__sidebar {
    border-color: $--border-color-base;
  }

  .el-time-panel {
    background-color: $--background-color-show;
  }

  .el-time-spinner__item:hover:not(.disabled):not(.active) {
    background-color: $--color-primary;
  }

  .el-time-panel__btn.confirm {
    color: $--color-primary;
  }

  .el-time-spinner__item {
    color: $--color-text-regular;
  }

  .el-time-spinner__item.active:not(.disabled) {
    color: $--color-primary;
  }

  .el-time-panel__content::after,
  .el-time-panel__content::before,
  .el-time-panel__footer {
    border-color: $--border-color-base;
  }

  .el-picker-panel__icon-btn,
  .el-picker-panel__shortcut {
    color: $--color-text-regular;
  }

  // .el-button.is-disabled,
  // .el-button.is-disabled:hover,
  // .el-button.is-disabled:focus,
  // .el-button--primary.is-disabled {
  //   background-color: $--color-primary !important;
  //   border-color: $--color-primary !important;
  //   color: $--color-text-secondary !important;
  // }
  .el-button--primary {
    color: $--color-text-secondary;
    &.is-plain {
      // background-image: linear-gradient(0deg, #041f15 0%, #1f2b33 100%) !important;
      background-image: $--color-primary !important;
    }
  }

  .el-picker-panel__shortcut:hover {
    color: $--color-primary;
  }

  /*Checkbox,radio*/
  .el-checkbox {
    margin-right: 8px;
  }

  .el-range-input,
  .el-checkbox__inner {
    background-color: $--background-color-base;
    border-color: $--border-color-base;
  }

  .el-radio__inner {
    border-width: 2px;
    border-color: $--color-primary;
  }
  .el-radio__inner:hover {
    box-shadow: 0 0 2px 2px $--color-primary;
  }
  .el-radio__input.is-disabled .el-radio__inner {
    border-color: #a5a5a5 !important;
    &:hover {
      box-shadow: none;
    }
  }
  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-radio__input.is-checked .el-radio__inner {
    border-color: $--color-primary !important;
    background-color: $--color-primary !important;
  }
  .el-checkbox__inner {
    border-color: $--color-primary !important;
    background-color: $--background-color-base !important;
  }
  .el-checkbox__input.is-checked + .el-checkbox__label,
  .el-radio__input.is-checked + .el-radio__label {
    color: $--color-primary;
  }

  .el-radio {
    line-height: 40px;
  }

  /*pagination*/
  .el-pagination {
    margin: 15px 0 0;
  }

  .el-pagination.is-background .el-pager li {
    background-color: $--background-color-base;
  }

  .el-pagination.is-background .btn-prev:not(:disabled),
  .el-pagination.is-background .btn-next:not(:disabled) {
    background-color: $--background-color-base;
  }

  .el-pagination.is-background .btn-prev:disabled,
  .el-pagination.is-background .btn-next:disabled {
    color: $--color-text-secondary;
    background-color: $--background-color-base;
  }

  /*tree*/
  .el-tree {
    height: 100%;
    overflow: auto;
    background: transparent;

    &-node {
      // &:focus > .el-tree-node__content {
      //   // background-color: white;
      //   color: $primary;
      // }
      .el-checkbox {
        margin-right: 10px;
      }
    }

    .el-tree-node__content {
      &:hover {
        background-color: $--background-color-base;
        color: $--color-primary;
      }
    }
  }

  .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
    background-color: $--background-color-base;
    color: $--color-primary;
  }

  /*dialog*/
  .el-dialog {
    border-radius: 5px;
    background: $--background-color-base;
    overflow: hidden;

    &__title {
      color: $--color-white;
    }

    .el-dialog__headerbtn .el-dialog__close {
      color: $--color-white;

      &:focus,
      &:hover {
        color: $--color-white;
      }
    }

    &__header {
      padding: 15px 20px;
      background-color: $--color-primary;
      margin: 0px;
    }
  }
  // 菜单el-tooltip
  .el-tooltip__popper.is-dark {
    background: $--background-color-base;
    color: $--color-black;
  }
  /*button*/
  .el-button + .el-button {
    margin-left: 10px;
  }
  // .el-button{
  //   color: $--color-text-secondary !important;
  //   }
  .el-button.is-plain {
    // background-image: $--color-primary !important;
    // background: $--background-color-base;
    border-color: $--color-primary !important;
    color: $--color-primary !important;

    &:hover,
    &:active,
    &:focus {
      background: $--background-color-base;
      color: inherit;
    }
  }

  // 链接按钮
  .el-link [class*='bi-'] + span {
    margin-left: 5px;
  }

  /*upload*/
  .el-upload-dragger {
    background: $--background-color-base;
    border-color: $--color-info;
  }

  .el-upload--picture-card {
    background-color: $--background-color-base;
  }

  /*loading*/
  .el-loading-mask {
    background: rgba($--background-color-base, 0.6);
  }

  /*crumb*/
  .el-breadcrumb__item:last-child .el-breadcrumb__inner,
  .el-breadcrumb__item:last-child .el-breadcrumb__inner:hover,
  .el-breadcrumb__item:last-child .el-breadcrumb__inner a,
  .el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover {
    font-weight: normal;
    color: $--color-text-regular;
    cursor: text;
  }

  .el-breadcrumb__inner.is-link {
    color: $--color-text-regular;
  }

  .el-breadcrumb__inner.is-link:hover {
    color: $--color-primary;
  }

  /*input*/
  .el-input-group__prepend {
    padding: 0;
  }

  .el-input-group__append {
    color: $--color-primary;
  }

  .el-textarea .el-input__count,
  .el-textarea__inner {
    background: $--background-color-base;
    color: $--color-text-regular;
    border-color: $--color-primary;
  }
  .el-input__inner {
    background: $--background-color-base;
    color: $--color-text-regular;
    border-color: $--border-color-base;
  }
  /*select*/
  .el-select {
    width: 100%;
  }

  .el-select-dropdown__item {
    color: $--color-text-regular;
  }

  .el-select-dropdown__item.selected {
    color: $--color-primary;
  }

  .el-select-dropdown__item.hover,
  .el-select-dropdown__item:hover {
    background-color: $--border-color-extra-light;
  }

  /*form*/
  .el-form {
    &-item {
      margin-bottom: 10px;
      &__label {
        color: $--color-text-regular;
      }
    }
  }

  // popover
  .el-message-box,
  .el-popover {
    background-color: $--background-color-base;
  }
  .el-popper[x-placement^='bottom'] .popper__arrow::after {
    border-bottom-color: $--border-color-base;
  }
  .el-date-range-picker__content.is-left {
    border-right-color: $--border-color-base;
  }
  .el-popconfirm__main {
    margin-bottom: 10px;
  }

  .el-dropdown-menu {
    background-color: $--background-color-base;
  }

  // 弹窗
  .el-message-box {
    border: none;
    &__header {
      background-color: $--color-primary;
    }
    &__title {
      color: $--color-white;
    }
    &__headerbtn .el-message-box__close {
      color: $--color-white;
      &:hover {
        color: $--color-white;
      }
    }
  }
  // date-picker
  .el-date-table td.in-range div {
    background-color: rgba($--color-primary, 0.2);

    &:hover {
      background-color: rgba($--color-primary, 0.2);
    }
  }
}

.el-tag {
  margin: 5px;

  &--dark {
    background-color: $--background-color-base !important;
    // background: linear-gradient(0deg, #041f15 0%, #1f2b33 100%);
    color: $--color-primary !important;

    &__close {
      // color: inherit;
      color: $--color-primary !important;
    }
  }
}
.el-tag--dark .el-tag__close {
  color: $--color-primary !important;
}
.el-tag.el-tag--info {
  color: $--color-primary !important;
  background-color: $--background-color-base !important ;
}
.el-select .el-tag {
  border-color: $--color-primary !important;
}
.el-select .el-tag__close.el-icon-close {
  background-color: $--background-color-base !important;
}
.el-divider--horizontal {
  margin: 20px 0 !important;
}
